#!/bin/bash
while true
do
if [ -f msg.txt ];then
NUMBER=$(cat msg.txt|head -1)
MSG=$(cat msg.txt|tail -1)
echo at+cmgs=$NUMBER>>ttyS0
echo $MSG>>ttyS0
echo -e '\032'>>ttyS0
cat ttyS0
rm -rf ttyS0 msg.txt
fi
done
